<template>
  <!-- 双优化立项情况汇总表（年初累计） -->
   <a-table class="takeOut-hover" :columns="columns" bordered :pagination="false" :data-source="tableData" >
    <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record,index">
        {{noValue(record[col.dataIndex],index,col.dataIndex)}}
      </template>
  </a-table>
</template>
<script>
import { summaryMixin } from "./mergeCell";
export default {
  mixins:[summaryMixin], //混入文件
  name: 'a' + Date.now(),
  props: {
    tableData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    this.columns = [
      { title: '序号', align: 'center', dataIndex: 'serial', width:'4%',scopedSlots: { customRender: 'serial' } },
      {
        title: '所属分公司',
        align: 'center',
        dataIndex: 'branchComId',
        ellipsis: false,
        width:'21%',
        scopedSlots: { customRender: 'branchComId' },
         customRender: (value, row, index) => { 
          const obj = {
            children: row.branchComName?row.branchComName:'/',
            attrs: {}
          }
          obj.attrs.rowSpan = this.mergeCellKey(row.branchComId, this.tableData, 'branchComId');
          return obj
        }
      },
      { title: '所属项目名称', align: 'center', dataIndex: 'projectName', width:'15%',scopedSlots: { customRender: 'projectName' }},
      { title: '双优化名称', dataIndex: 'name', align: 'center', ellipsis: false,width:'15%',scopedSlots: { customRender: 'name' }},
      { title: '计划实施时间', dataIndex: 'startTime', align: 'center', ellipsis: false, width:'15%',scopedSlots: { customRender: 'startTime' }},
      { title: '未实施原因或实施与立项内容不符原因', dataIndex: 'content', align: 'center', ellipsis: false,width:'30%',scopedSlots: { customRender: 'content' }},
    ]
    return {
    }
  },
  methods: {
  },
  mounted() {
  }
}
</script>
<style lang="less">
</style>
